				<textarea id="invoice-form-item-template" style="display:none;">
					<tr id="new-{0}">
						<td style="background-color:#FFF;"><a href="javascript:void(0);" class="row-rm-btn">Remove Item</a></td>
						<td><input type="text" name="new_item[{0}][name]" class="ui-corner-all ui-input"/></td>
						<td><input type="text" name="new_item[{0}][description]" class="ui-corner-all ui-input"/></td>
						<td class="currency"><input type="number" step="0.01" min="0" name="new_item[{0}][rate]"  class="ui-corner-all ui-input rate" value="0.0" onchange="javascript: updateInvoiceRowTotal(this);"/></td>
						<td> <input type="number" step="0.01" min="0" name="new_item[{0}][quantity]"   class="ui-corner-all ui-input quantity" value="0.0" onchange="javascript: updateInvoiceRowTotal(this);"/></td>
						<td class="currency"><input type="number" step="0.01" min="0" class="ui-corner-all ui-input itmtotal" value="0.0" readonly="readonly"/></td>
					</tr>
				</textarea>
				<textarea id="invoice-form-olditem-template" style="display:none;">
					<tr id="old-{0}">
						<td style="background-color:#FFF;"><a href="javascript:void(0);" class="row-rm-btn">Remove Item</a><input type="hidden" name="item[{0}][invoice_item_id]" value="{0}" /></td>
						<td><input type="text" name="item[{0}][name]"   class="ui-corner-all ui-input" value="{1}"/></td>
						<td><input type="text" name="item[{0}][description]"  class="ui-corner-all ui-input" value="{2}"/></td>
						<td class="currency"><input type="number" step="0.01" min="0" name="item[{0}][rate]"  class="ui-corner-all ui-input rate" value="{3}" onchange="javascript: updateInvoiceRowTotal(this);"/></td>
						<td><input type="number" step="0.01" min="0" name="item[{0}][quantity]"   class="ui-corner-all ui-input quantity" value="{4}" onchange="javascript: updateInvoiceRowTotal(this);"/></td>
						<td class="currency"><input type="number" step="0.01" min="0" class="ui-corner-all ui-input itmtotal" value="{5}" readonly="readonly"/></td>
					</tr>
				</textarea>
				<form id="invoice-form">
					<input type="hidden" id="invoice_act" name="act" value="add" />
					<div class="invoice-form-col css_left">
						<div>
							<label for="invoice_client_id" class="ui-widget-header ui-corner-top above">Client</label>
							<select data-placeholder="Choose a Client" name="client_id" id="invoice_client_id" style="width:350px;" class="chzn-select">
								<option value="" selected="selected"></option>
								<?
								foreach($clients as $row){
								?>
								<option value="<?=$row->id?>"><?=$row->name ?></option>
								<?
								}
								?>
							</select>
						</div>
						<div>
							<label for="invoice_address" class="ui-widget-header ui-corner-top above" style="">Address</label>
							<textarea name="address" id="invoice_address" class="ui-input ui-corner-bottom below required"></textarea>
						</div>
					</div>
					<div class="invoice-form-col css_right">
						<div>
							<label for="invoice_id" class="ui-widget-header ui-corner-left">Invoice #</label>
							<input type="text" name="invoice_id" id="invoice_id" value="" class="ui-input ui-corner-right required" readonly="readonly"/>
						</div>
						<div>
							<label for="invoice_issue_date" class="ui-widget-header ui-corner-left">Date Issued</label>
							<input type="text" name="issue_date" id="invoice_issue_date" value="" class="datepicker ui-input ui-corner-right required" />
						</div>
						<div>
							<label for="invoice_discount" class="ui-widget-header ui-corner-left">Discount (%)</label>
							<input type="number" step="0.01" min="0" name="discount" id="invoice_discount" value="0.0" class="ui-input ui-corner-right" onchange="javascript: updateInvoiceSubTotals()" />
						</div>
					</div>
					<div class="invoice-form-col-full" style="float:none; clear:both;">
						<table id="invoice_items" width="100%">
							<thead>
								<tr>
									<td style="background-color:#FFF;"></td>
									<th class="ui-widget-header">Item/Task</th>
									<th class="ui-widget-header">Description/Notes</th>
									<th class="ui-widget-header">Cost/Rate</th>
									<th class="ui-widget-header">Qty/Hrs</th>
									<th class="ui-widget-header">Item Total</th>
								</tr>
							</thead>
							<tbody id="invoice_items_body">
								<!--  -->
							</tbody>
						</table>
					</div>
					<div class="invoice-form-col css_left">
						<a href="javascript:void(0);" id="invoice-form-add-itm-btn" style="margin-top:1px">Add Item</a>
					</div>
					<div class="invoice-form-col css_right">
						<div style="margin:0px;">
							<label for="invoice_discount_amount" class="ui-widget-header" style="border-top:0px solid #fff;">Discount Amt:</label>
							<input type="number" step="0.01" min="0" id="invoice_discount_amount" value="0.0" class="ui-input" style="border-top:0px solid #fff;" readonly="readonly"/>
						</div>
						<div style="margin:0px;">
							<label for="invoice_subtotal" class="ui-widget-header" style="border-top:0px solid #fff;">Subtotal</label>
							<input type="number" step="0.01" min="0" name="subtotal" id="invoice_subtotal" value="0.0" class="ui-input" style="border-top:0px solid #fff;" readonly="readonly" onchange="javascript: updateInvoiceTotals()"/>
						</div>
						<div style="margin:0px;">
							<label for="invoice_taxes" class="ui-widget-header" style="border-top:0px solid #fff;">Taxes</label>
							<input type="number" step="0.01" min="0" name="taxes" id="invoice_taxes" value="0.0" class="ui-input" style="border-top:0px solid #fff;" onchange="javascript: updateInvoiceTotals()"/>
						</div>
						<div style="margin:0px;">
							<label for="invoice_paid" class="ui-widget-header" style="border-top:0px solid #fff;">Amt. Paid</label>
							<input type="number" step="0.01" min="0" name="paid" id="invoice_paid" value="0.0" class="ui-input" style="border-top:0px solid #fff;" onchange="javascript: updateInvoiceTotals()"/>
						</div>
						<div style="margin:0px;">
							<label for="invoice_total" class="ui-widget-header ui-corner-bl" style="border-top:0px solid #fff;">Outstanding</label>
							<input type="number" step="0.01" min="0" name="total" id="invoice_total" value="0.0" class="ui-input ui-corner-br" style="border-top:0px solid #fff;" readonly="readonly"/>
						</div>
					</div>
					<div class="ui-helper-clearfix"> </div>
					<div class="invoice-form-col css_left">
						<div>
							<label for="invoice_terms" class="ui-widget-header ui-corner-top above" >Terms</label>
							<textarea name="invoice_terms" id="invoice_terms" class="ui-input ui-corner-bottom below required"></textarea>
						</div>
					</div>
					<div class="invoice-form-col css_right">
						<div>
							<label for="invoice_notes" class="ui-widget-header ui-corner-top above" >Notes</label>
							<textarea name="invoice_notes" id="invoice_notes" class="ui-input ui-corner-bottom below required"></textarea>
						</div>
					</div>
				</form>
